// JavaScript Document

function startLoading(txtload){	/**启动加载效果**/
	//需要动态创建load背景的DIV
	var bgdiv = document.createElement("div");
	//需要动态创建load效果的DIV
	var objdiv = document.createElement("div");
	bgdiv.id = "loader_all_bg";
	objdiv.id = "loader_container";
	objdiv.innerHTML = "<div id=\"loader\"><div id=\"loader_text\">"+txtload+"</div><div id=\"loader_bg\"></div></div>";
	//设置背景效果的宽高
	_scrollWidth = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth); 
	_scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight); 
	bgdiv.style.width = _scrollWidth + "px";
	bgdiv.style.height = _scrollHeight + "px";
	document.body.appendChild(bgdiv);
	document.body.appendChild(objdiv);
}

function stopLoading(){	/**停止加载效果**/
	var bgdiv = document.getElementById("loader_all_bg");
	var objdiv = document.getElementById("loader_container");
	if(bgdiv != null){
		document.body.removeChild(bgdiv);	
	}
	if(objdiv != null){
		document.body.removeChild(objdiv);	
	}
}

function coverbg(){	/**启动遮罩**/
	//需要动态创建load背景的DIV
	var bgdiv = document.createElement("div");
	bgdiv.id = "loader_all_bg";
	//设置背景效果的宽高
	_scrollWidth = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth); 
	_scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight); 
	bgdiv.style.width = _scrollWidth + "px";
	bgdiv.style.height = _scrollHeight + "px";
	document.body.appendChild(bgdiv);
}

function uncoverbg(){	/**清除遮罩**/
	var bgdiv = document.getElementById("loader_all_bg");
	if(bgdiv != null){
		document.body.removeChild(bgdiv);	
	}
}